<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>请假汇总统计</h2>
    </div>
     <form action="{:U('leavestatist')}" method="post">
            <div class="form-item cf" style="padding:15px">
            <script src="__PUBLIC__//date/js/jquery.1.7.2.min.js"></script>
            <script src="__PUBLIC__//date/js/mobiscroll_002.js" type="text/javascript"></script>
            <script src="__PUBLIC__//date/js/mobiscroll_004.js" type="text/javascript"></script>
            <link href="__PUBLIC__//date/css/mobiscroll_002.css" rel="stylesheet" type="text/css">
            <link href="__PUBLIC__//date/css/mobiscroll.css" rel="stylesheet" type="text/css">
            <script src="__PUBLIC__//date/js/mobiscroll.js" type="text/javascript"></script>
            <script src="__PUBLIC__//date/js/mobiscroll_003.js" type="text/javascript"></script>
            <script src="__PUBLIC__//date/js/mobiscroll_005.js" type="text/javascript"></script>
            <link href="__PUBLIC__//date/css/mobiscroll_003.css" rel="stylesheet" type="text/css">
            <php>
                    $lastmonth = date('Y-m-d',strtotime('-1 month'));
                    $date = date('Y-m-d');
                </php>
                    <input value="{$lastmonth}" class="" readonly="readonly" name="createtime" id="staDate" type="text">
                    <input value="{$date}" class="" readonly="readonly" name="endDate" id="endDate" type="text">
                <script type="text/javascript">
                    $(function () {
                        var currYear = (new Date()).getFullYear();  
                        var opt={};
                        opt.date = {preset : 'date'};
                        opt.datetime = {preset : 'datetime'};
                        opt.time = {preset : 'time'};
                        opt.default = {
                            theme: 'android-ics light', //皮肤样式
                            display: 'modal', //显示方式 
                            mode: 'scroller', //日期选择模式
                            dateFormat: 'yyyy-mm-dd',
                            lang: 'zh',
                            showNow: true,
                            nowText: "今天",
                            startYear: currYear - 10, //开始年份
                            endYear: currYear + 10 //结束年份
                        };

                        $("#staDate").mobiscroll($.extend(opt['date'], opt['default']));

                        $("#endDate").mobiscroll($.extend(opt['date'], opt['default']));
                        
                       
                    });
                </script> 
        <br/>
        <br/>
                <input type="radio" name="d_type" value="1" checked="checked" />请假日期
                <input type="radio" name="d_type" value="2" />审核日期<br/><br/>
                <input type="submit" name="anniu" value="搜索">
            </form>
        </div>
    </div>
    <div class="data-table with-padding">
        <table class="table table-bordered table-striped ">
            <thead>
            <tr>
                <th class="">状态</th>
                <th class="">总人数</th>
                <th class="">请假日期</th>
                <th class="">审核时间</th>
            </thead>
            <tbody>
                    <tr>
                        <td>总记录</td>
                        <td>{$total}</td>
                        <td>{$vo.leave_date|time_format}</td>
                        <td>{$vo.check_time|time_format}</td>
                    </tr>
                    <tr>
                        <td>已审核</td>
                        <td>{$succ}</td>
                        <td>{$vo.leave_date|time_format}</td>
                        <td>{$vo.check_time|time_format}</td>
                    </tr>

                    <tr>
                        <td>未审核</td>
                        <td>{$erro}</td>
                        <td>{$vo.leave_date|time_format}</td>
                        <td>{$vo.check_time|time_format}</td>
                    </tr>
            </tbody>
        </table>
    </div>
    <div class="with-padding">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__CSS__/status.css"></script>
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    
    <script type="text/javascript">
        //搜索功能
        $("#search").click(function () {
            var url = $(this).attr('url');
            var query = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            if (url.indexOf('?') > 0) {
                url += '&' + query;
            } else {
                url += '?' + query;
            }
            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
        //导航高亮
        highlight_subnav("{:U('leavestatist')}");
    </script>
</block>